package org.wattdepot.cli.command;

import java.util.List;
import org.wattdepot.cli.CommandLineInterface;
import org.wattdepot.client.WattDepotClientException;

/**
 * Prints a table summarizing the public sources in the system, one per line.
 * 
 * @author Anthony Xu & John Mack
 *
 */
public class ListSources implements WattDepotCliCommand {
  
  /**
   * Prints a table summarizing the public sources in the system, one per line.
   * 
   * @param cli WattDepotClient with hostUri = http://server.wattdepot.org:8182/wattdepot/
   * @param commands user's command line input
   * @return string to output
   */
  public String doCommand(CommandLineInterface cli, List<String> commands) {
    String str = "";
    try {
      str = cli.getSourcesInfo();
    }
    catch (WattDepotClientException e) {
      e.printStackTrace();
    }
    return str;
  }

}
